package com.apis.restful.user.model;

import com.apis.javacommon.base.BaseEntity;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

public class User extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "User";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_USERNAME = "username";
	public static final String ALIAS_PASSWORD = "password";
	public static final String ALIAS_DBROUTERID = "dbrouterid";
	public static final String ALIAS_CORPID = "corpid";
	public static final String ALIAS_TEL = "tel";
	public static final String ALIAS_EMAIL = "email";
	public static final String ALIAS_VDEF1 = "vdef1";
	public static final String ALIAS_VDEF2 = "vdef2";
	public static final String ALIAS_VDEF3 = "vdef3";
	public static final String ALIAS_VDEF4 = "vdef4";
	public static final String ALIAS_VDEF5 = "vdef5";
	public static final String ALIAS_VDEF6 = "vdef6";
	public static final String ALIAS_VDEF7 = "vdef7";
	public static final String ALIAS_VDEF8 = "vdef8";
	public static final String ALIAS_VDEF9 = "vdef9";
	public static final String ALIAS_ISDELETED = "isdeleted";
	
	//date formats
	
	//columns START
    /** username       db_column: username */	
	private String username;
    /** password       db_column: password */
	private String password;
    /** dbrouterid       db_column: dbrouterid */
	private Integer dbrouterid;
    /** corpid       db_column: corpid */
	private Integer corpid;
    /** tel       db_column: tel */
	private String tel;
    /** email       db_column: email */
	private String email;
    /** vdef1       db_column: vdef1 */
	private String vdef1;
    /** vdef2       db_column: vdef2 */
	private String vdef2;
    /** vdef3       db_column: vdef3 */
	private String vdef3;
    /** vdef4       db_column: vdef4 */
	private String vdef4;
    /** vdef5       db_column: vdef5 */
	private String vdef5;
    /** vdef6       db_column: vdef6 */
	private String vdef6;
    /** vdef7       db_column: vdef7 */
	private String vdef7;
    /** vdef8       db_column: vdef8 */
	private String vdef8;
    /** vdef9       db_column: vdef9 */
	private String vdef9;
    /** isdeleted       db_column: isdeleted */
	private Integer isdeleted;
	//columns END

	public void setUsername(String value) {
		this.username = value;
	}

	public String getUsername() {
		return this.username;
	}
	public void setPassword(String value) {
		this.password = value;
	}

	public String getPassword() {
		return this.password;
	}
	public void setDbrouterid(Integer value) {
		this.dbrouterid = value;
	}

	public Integer getDbrouterid() {
		return this.dbrouterid;
	}
	public void setCorpid(Integer value) {
		this.corpid = value;
	}

	public Integer getCorpid() {
		return this.corpid;
	}
	public void setTel(String value) {
		this.tel = value;
	}

	public String getTel() {
		return this.tel;
	}
	public void setEmail(String value) {
		this.email = value;
	}

	public String getEmail() {
		return this.email;
	}
	public void setVdef1(String value) {
		this.vdef1 = value;
	}

	public String getVdef1() {
		return this.vdef1;
	}
	public void setVdef2(String value) {
		this.vdef2 = value;
	}

	public String getVdef2() {
		return this.vdef2;
	}
	public void setVdef3(String value) {
		this.vdef3 = value;
	}

	public String getVdef3() {
		return this.vdef3;
	}
	public void setVdef4(String value) {
		this.vdef4 = value;
	}

	public String getVdef4() {
		return this.vdef4;
	}
	public void setVdef5(String value) {
		this.vdef5 = value;
	}

	public String getVdef5() {
		return this.vdef5;
	}
	public void setVdef6(String value) {
		this.vdef6 = value;
	}

	public String getVdef6() {
		return this.vdef6;
	}
	public void setVdef7(String value) {
		this.vdef7 = value;
	}

	public String getVdef7() {
		return this.vdef7;
	}
	public void setVdef8(String value) {
		this.vdef8 = value;
	}

	public String getVdef8() {
		return this.vdef8;
	}
	public void setVdef9(String value) {
		this.vdef9 = value;
	}

	public String getVdef9() {
		return this.vdef9;
	}
	public void setIsdeleted(Integer value) {
		this.isdeleted = value;
	}

	public Integer getIsdeleted() {
		return this.isdeleted;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Username",getUsername())
			.append("Password",getPassword())
			.append("Dbrouterid",getDbrouterid())
			.append("Corpid",getCorpid())
			.append("Tel",getTel())
			.append("Email",getEmail())
			.append("Vdef1",getVdef1())
			.append("Vdef2",getVdef2())
			.append("Vdef3",getVdef3())
			.append("Vdef4",getVdef4())
			.append("Vdef5",getVdef5())
			.append("Vdef6",getVdef6())
			.append("Vdef7",getVdef7())
			.append("Vdef8",getVdef8())
			.append("Vdef9",getVdef9())
			.append("Isdeleted",getIsdeleted())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof User == false) return false;
		if(this == obj) return true;
		User other = (User)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

